home *** CD-ROM | disk | FTP | other *** search
- Path: noc.tor.hookup.net!news
- From: Richard Steadman <rsteadma@mmltd.com>
- Newsgroups: comp.lang.c
- Subject: Re: The size of a file
- Date: 29 Jan 1996 20:12:11 GMT
- Organization: Micromedia
- Message-ID: <4ej9mr$fh5@noc.tor.hookup.net>
- References: <4ebc03$4gv@gate.compart.fi> <4edo88$4c7@news.xs4all.nl>
- NNTP-Posting-Host: keeper.mmltd.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- falstaff@xs4all.nl (Falstaff) wrote:
- >Fredrik Sandstrom <fred@spider.compart.fi> writes:
- >
- >>This is driving me nuts. I can't find a simple way to get the size of a
- >>disk file. This must be possible using the standard C library, but I
- >>haven't figured out how!
- >
- >f=fopen()
- >fseek(f,SEEK_END,0)
- >ftell(f)
- >fclose(f)
- >
- >done
- >--
-
- But what if the file size doesn't fit in a long int (in DOS)? It
- seems that a long int (which ftell() returns) only goes up to 2 meg.
-
-
-
-